/**
 * Copyright ©2012-2018 HopeHaiyang Corporation, All Rights Reserved
 * http://www.wuhanhope.com
 */
package hope.platform.data.web;

import hope.platform.data.domain.DataType;
import hope.platform.data.server.data.header.DataTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * class info
 *
 * @author hujia
 *         Create at 2018/8/7 10:27
 */
@RestController
@RequestMapping("/dataType")
public class DataTypeController {

    @Autowired
    private DataTypeService service;

    @GetMapping("/all")
    public List<DataType> getAll() {
        return service.getAll();
    }

    @PostMapping
    public DataType add(@RequestBody DataType dataType) {
        return service.add(dataType);
    }

}
